function [F,info] = Biggs6Test(N)
% BIGGS6TEST - 测试就算Biggs6函数
%   输入变量：
%   N  相应的n的数组
%   输出变量：
%   F：最优值数列
%   info：相关info
[stop , n ] =check(N);
if stop, error('x must be a real valued vector'), end

    for i = 1:n,
        x0 = ones(6,1);
        x0(2)=2;
        x = zeros(6,5);
        m = N(i);
        if m <6,
           error( 'm should be larger than 6');
        end
        maxstep = 10000;
        % 阻尼Newton法。
        %'damping newton'
        opts = [0,1e-8,1e-8,1e-8,maxstep,100];
        [x(:,1),F(i,1),info(:,1,i)]=Newton(@biggs6,x0,opts,m);
        %'multi Newton'
        opts = [1,1e-8,1e-8,1e-8,maxstep,100];
        [x(:,2),F(i,2),info(:,2,i)]=Newton(@biggs6,x0,opts,m);
        %'Quasi Newton:SR1'
        opts = [2,1e-8,1e-8,1e-8,maxstep,100];
        [x(:,3),F(i,3),info(:,3,i)]=Newton(@biggs6,x0,opts,m);
        %'Quasi Newton:BFGS'
        opts = [3,1e-8,1e-8,1e-8,maxstep,100];
        [x(:,4),F(i,4),info(:,4,i)]=Newton(@biggs6,x0,opts,m);
        %'Quasi Newton:DFP'              
        opts = [4,1e-8,1e-8,1e-8,maxstep,100];
        [x(:,5),F(i,5),info(:,5,i)]=Newton(@biggs6,x0,opts,m);
        %        'biggs',m,F,info,
    end
end
function [err,n] = check(x)
% CHECK - check x
%   
    err = 0; sx = size(x); n = max(sx);
    if  (min(sx) ~= 1) | ~isreal(x) | any(isnan(x(:))) | isinf(norm(x(:))) 
        err = -1; 
    end    
end
